import time

def bubble_sort(arr):
    n = len(arr)
    for i in range(n):
        for j in range(0, n-i-1):
            if arr[j] > arr[j+1]:
                arr[j], arr[j+1] = arr[j+1], arr[j]

start = time.time()
with open('m1_sorted.txt', 'r') as file:
    data = file.read().split()
    data = list(map(int, data))
    bubble_sort(data)
    print("m1_sorted.txt", (time.time() - start) * 1000, "milliseconds")

start = time.time()
with open('m2_reverse.txt', 'r') as file:
    data = file.read().split()
    data = list(map(int, data))
    bubble_sort(data)
    print("m2_reverse.txt", (time.time() - start) * 1000, "milliseconds")

start = time.time()
with open('m3_shuffle.txt', 'r') as file:
    data = file.read().split()
    data = list(map(int, data))
    bubble_sort(data)
    print("m3_shuffle.txt", (time.time() - start) * 1000, "milliseconds")